fun call f arg = print ((Int32.toString (f arg) handle Overflow => "Overflow" | Div => "Div") ^ "\n")
fun callS f arg = print ((f arg handle Overflow => "Overflow" | Div => "Div") ^ "\n")
fun callO f arg = print (((case f arg of SOME x => "SOME " ^ Int32.toString x | NONE => "NONE") handle Overflow => "Overflow" | Div => "Div") ^ "\n")
fun callP f arg = print (((case f arg of (x, y) => "(" ^ Int32.toString x ^ "," ^ Int32.toString y ^ ")") handle Overflow => "Overflow" | Div => "Div") ^ "\n")
fun bin (x, y) = ( print (Int32.toString x ^ " + " ^ Int32.toString y ^ " = ")
                 ; call Int32.+ (x, y)
                 ; print (Int32.toString x ^ " - " ^ Int32.toString y ^ " = ")
                 ; call Int32.- (x, y)
                 ; print (Int32.toString x ^ " * " ^ Int32.toString y ^ " = ")
                 ; call Int32.* (x, y)
                 ; print (Int32.toString x ^ " div " ^ Int32.toString y ^ " = ")
                 ; call Int32.div (x, y)
                 ; print (Int32.toString x ^ " mod " ^ Int32.toString y ^ " = ")
                 ; call Int32.mod (x, y)
                 ; print (Int32.toString x ^ " quot " ^ Int32.toString y ^ " = ")
                 ; call Int32.quot (x, y)
                 ; print (Int32.toString x ^ " rem " ^ Int32.toString y ^ " = ")
                 ; call Int32.rem (x, y)
                 );
fun un x = ( print ("~ " ^ Int32.toString x ^ " = ")
           ; call Int32.~ x
           ; print ("abs " ^ Int32.toString x ^ " = ")
           ; call Int32.abs x
           (* ; print ("fmt BIN " ^ Int32.toString x ^ " = ")
           ; callS (Int32.fmt StringCvt.BIN) x ... not implemented yet *)
           ; print ("fmt OCT " ^ Int32.toString x ^ " = ")
           ; callS (Int32.fmt StringCvt.OCT) x
           ; print ("fmt DEC " ^ Int32.toString x ^ " = ")
           ; callS (Int32.fmt StringCvt.DEC) x
           ; print ("fmt HEX " ^ Int32.toString x ^ " = ")
           ; callS (Int32.fmt StringCvt.HEX) x
           ; print ("toLarge " ^ Int32.toString x ^ " = ")
           ; callS (LargeInt.toString o Int32.toLarge) x
           );
List.app un
[~2147483648
,~2147483647
,~77
,~3
,~2
,~1
,0
,1
,2
,3
,78
,2147483646
,2147483647
,1144840752
,~1913994601
,477126751
,~550241521
,~167378736
,~825788974
,1294491537
,~1016783337
,~842157429
,57534559
,178802164
,148898098
,1622309563
,384086917
,1059572110
,~1010057431
,809201400
,2108944990
,~1423401636
,~9314725
,580535533
,~60462977
,42173506
,~1244198391
,~155416245
,578536091
,~848818054
,~738569704
,843505297
,915780832
,~1997966006
,~1047164766
,605389538
,1633732331
,644804127
,~1169784920
,~2028850213
,637053474
,~261085742
,~452348227
,~2054800312
,823738987
,~290329616
,1105878397
,~390947178
,~82484296
,~1637257353
,~1744525921
,1037774837
,~117579738
];
List.app bin
[(~2147483648,~2147483648)
,(~2147483648,~2147483647)
,(~2147483648,~35)
,(~2147483648,~3)
,(~2147483648,~2)
,(~2147483648,~1)
,(~2147483648,0)
,(~2147483648,1)
,(~2147483648,2)
,(~2147483648,3)
,(~2147483648,99)
,(~2147483648,2147483646)
,(~2147483648,2147483647)
,(~2147483647,~2147483648)
,(~2147483647,~2147483647)
,(~2147483647,~35)
,(~2147483647,~3)
,(~2147483647,~2)
,(~2147483647,~1)
,(~2147483647,0)
,(~2147483647,1)
,(~2147483647,2)
,(~2147483647,3)
,(~2147483647,99)
,(~2147483647,2147483646)
,(~2147483647,2147483647)
,(~77,~2147483648)
,(~77,~2147483647)
,(~77,~35)
,(~77,~3)
,(~77,~2)
,(~77,~1)
,(~77,0)
,(~77,1)
,(~77,2)
,(~77,3)
,(~77,99)
,(~77,2147483646)
,(~77,2147483647)
,(~3,~2147483648)
,(~3,~2147483647)
,(~3,~35)
,(~3,~3)
,(~3,~2)
,(~3,~1)
,(~3,0)
,(~3,1)
,(~3,2)
,(~3,3)
,(~3,99)
,(~3,2147483646)
,(~3,2147483647)
,(~2,~2147483648)
,(~2,~2147483647)
,(~2,~35)
,(~2,~3)
,(~2,~2)
,(~2,~1)
,(~2,0)
,(~2,1)
,(~2,2)
,(~2,3)
,(~2,99)
,(~2,2147483646)
,(~2,2147483647)
,(~1,~2147483648)
,(~1,~2147483647)
,(~1,~35)
,(~1,~3)
,(~1,~2)
,(~1,~1)
,(~1,0)
,(~1,1)
,(~1,2)
,(~1,3)
,(~1,99)
,(~1,2147483646)
,(~1,2147483647)
,(0,~2147483648)
,(0,~2147483647)
,(0,~35)
,(0,~3)
,(0,~2)
,(0,~1)
,(0,0)
,(0,1)
,(0,2)
,(0,3)
,(0,99)
,(0,2147483646)
,(0,2147483647)
,(1,~2147483648)
,(1,~2147483647)
,(1,~35)
,(1,~3)
,(1,~2)
,(1,~1)
,(1,0)
,(1,1)
,(1,2)
,(1,3)
,(1,99)
,(1,2147483646)
,(1,2147483647)
,(2,~2147483648)
,(2,~2147483647)
,(2,~35)
,(2,~3)
,(2,~2)
,(2,~1)
,(2,0)
,(2,1)
,(2,2)
,(2,3)
,(2,99)
,(2,2147483646)
,(2,2147483647)
,(3,~2147483648)
,(3,~2147483647)
,(3,~35)
,(3,~3)
,(3,~2)
,(3,~1)
,(3,0)
,(3,1)
,(3,2)
,(3,3)
,(3,99)
,(3,2147483646)
,(3,2147483647)
,(78,~2147483648)
,(78,~2147483647)
,(78,~35)
,(78,~3)
,(78,~2)
,(78,~1)
,(78,0)
,(78,1)
,(78,2)
,(78,3)
,(78,99)
,(78,2147483646)
,(78,2147483647)
,(2147483646,~2147483648)
,(2147483646,~2147483647)
,(2147483646,~35)
,(2147483646,~3)
,(2147483646,~2)
,(2147483646,~1)
,(2147483646,0)
,(2147483646,1)
,(2147483646,2)
,(2147483646,3)
,(2147483646,99)
,(2147483646,2147483646)
,(2147483646,2147483647)
,(2147483647,~2147483648)
,(2147483647,~2147483647)
,(2147483647,~35)
,(2147483647,~3)
,(2147483647,~2)
,(2147483647,~1)
,(2147483647,0)
,(2147483647,1)
,(2147483647,2)
,(2147483647,3)
,(2147483647,99)
,(2147483647,2147483646)
,(2147483647,2147483647)
,(2068434062,~873700605)
,(2030120033,371999830)
,(403597648,~546768718)
,(~362197797,~790770355)
,(1465410881,289350603)
,(~1584089434,~2040107462)
,(~485920637,1162204410)
,(270913979,818503303)
,(~16032124,248447337)
,(122346013,1649877484)
,(~1845208350,~1070903027)
,(507373036,~1872069986)
,(519770588,1763880987)
,(~934065481,1005456569)
,(~153072366,1969624512)
,(~1405117757,~471844920)
,(2051786028,906284316)
,(2145316450,~1427315927)
,(~9407931,~1885566093)
,(~877709934,2110678962)
,(247915965,~1873758424)
,(1274136915,1922470873)
,(2080821165,~734427665)
,(790559880,1874263122)
,(~1359372849,1949565526)
,(~1334796785,686301502)
,(1810062798,~226435708)
,(~791507411,1224192106)
,(~1491683280,563550330)
,(1437378545,428996343)
,(1838404274,~1550310306)
,(~937298642,~1239294837)
,(1247953793,~159634637)
,(~235323031,1036990783)
,(223172919,~2109472721)
,(263262295,383485344)
,(~1223759743,1420832945)
,(865343713,1108156332)
,(193630043,595495029)
,(367760352,~529640788)
,(~1738980351,2028514110)
,(~662947926,723229236)
,(~1473655037,1458778430)
,(~721698938,~1125194361)
,(1534652007,~1874007207)
,(2069525414,~870850651)
,(581074716,1145023407)
,(~807405073,1573771467)
,(1064516728,~1229548605)
,(~70111107,~1206874024)
,(1352273948,~1979773493)
,(~1918688812,~1061153555)
,(2093028687,296384314)
,(~1475321711,~648167133)
,(543872043,~252623663)
,(~1929623995,~1544890910)
,(~807394761,1570076925)
,(781279378,~268684647)
,(1692283666,~396258862)
,(~1891980010,~594114087)
,(502593528,~1883832071)
,(~662083221,2035208649)
,(469782768,1956252572)
,(905697100,~1236472484)
,(~1341023821,~1696662237)
,(~211076416,~1909159683)
,(~1973427938,1852404489)
,(826339978,~1875630780)
,(~831324819,342797514)
,(~432744325,~1460666433)
,(227816277,~1835055591)
,(~1582694961,724458028)
,(~136080431,264820433)
,(~242208645,~333272157)
,(2121582806,~1580754849)
,(~712746303,230179814)
,(1856564725,1752277816)
,(~479822614,~1627992236)
,(~1286043409,~1381202031)
,(1372752444,~996042745)
,(~2080890289,507111983)
,(~1569768410,~999753061)
,(~1263100669,1733510538)
,(~1729223464,609909366)
,(~667710493,1469480574)
,(~1242973186,~1881980273)
,(1210551437,970432603)
,(761195940,1802982680)
,(~415903584,~364018133)
,(~830614834,~1748831897)
,(~80374986,~2109842721)
,(364015750,~508069473)
,(~2004011981,~1097603328)
,(~1552031987,~914101398)
,(~714823850,1241625931)
,(~1188187266,~2014783250)
,(~1691550323,~1525516425)
,(1047025305,~889877595)
,(846892041,1764489729)
,(~1212908710,825269993)
,(737475800,69480193)
,(~417633230,226858154)
,(1453600563,~1296389041)
,(132935715,~1773177971)
,(908819282,~747256337)
,(~1973360262,669112510)
,(502402013,1520324315)
,(~717115161,~1569570231)
,(1915492698,1758612804)
,(~2035480095,~149963765)
,(~741021098,1751154910)
,(921466503,2131410165)
,(~1118009854,220638625)
,(~1503690333,1211907762)
,(~1323423381,~1192873099)
,(1264727709,~1436143510)
,(943289491,457332267)
,(~841901384,~1859697651)
,(~1635442955,1373801889)
,(~640342559,~411106500)
,(1086424887,~2063245716)
,(~141985832,~120330100)
,(374742912,742607884)
,(1451523260,~1891209456)
,(~918247262,~1466548299)
,(1222071374,264043427)
,(580630084,52393860)
,(~2090327004,1506900012)
,(~1301466606,807020154)
,(1871541613,2089162750)
,(194104809,~762474974)
,(2125482500,116412071)
,(1752152615,~919900372)
,(~456695486,~167267787)
,(~1984032962,~1991118512)
,(~2036470007,1297781837)
,(22151558,~941502868)
,(1807751305,~989277279)
,(1684334223,1577491675)
,(1903269592,838063516)
,(53374991,~1319374883)
,(670195023,1407547302)
,(2108982977,1634925658)
,(~903532831,~19290976)
,(1889030570,~1061957122)
,(~1283763410,~1364553321)
,(~88191102,1399838475)
,(888956411,1079381232)
,(759161730,~1056673316)
,(~1059063439,~1286945388)
,(~45840406,~1684510359)
,(995440369,~1888929581)
,(~1227799620,~2009824492)
,(~250927947,2127425623)
,(~1693427250,~1072239083)
,(1005544431,~2035105633)
,(~580672090,713119127)
,(~1820118968,~480894214)
,(~1914400744,572202542)
,(~556532736,~1705234530)
,(1777478773,~1019837495)
,(232524400,1086247758)
,(~877913018,1767580053)
,(~1771664848,~134056745)
,(1380552102,~1795968882)
,(1751682569,67600071)
,(~1245138328,1949068434)
,(~288866468,~665491247)
,(457336928,1293833753)
,(793182790,1481468609)
,(1038264622,1029438204)
,(~734219464,~720232820)
,(~2012868995,1878241083)
,(1231152148,329004808)
,(331714453,~1938592033)
,(1581541989,~874374934)
,(~61129286,981865375)
,(259183304,~1614901509)
,(~1218707945,1064673982)
,(~1734197373,~955702001)
,(726096637,~2076484638)
,(1657674454,791863926)
,(1483460324,~1022441948)
,(~1696142901,~1721490588)
,(1871143665,~1053474234)
,(~1696515155,~727908651)
,(~1577923035,~1955295497)
,(~2006504809,47170146)
,(1977279851,~904174079)
,(~1657860835,823052342)
,(~614341095,261852412)
,(133993291,~282506178)
,(~1099247766,2029925176)
,(~1854343187,1985706328)
,(825325275,1929148363)
,(~1175550102,1602646613)
,(1107317997,~798908333)
,(1044677609,428017562)
,(~1049206886,~882329189)
,(159600264,~405737001)
,(~1666207588,1914952477)
,(948995285,~1415026107)
,(77064091,~880856023)
,(~1570009003,1677135885)
,(~1861807676,~6865020)
,(~2069571162,1909238837)
,(156390214,~1590682184)
,(~259164292,1200013331)
,(216273614,1681592411)
,(240166954,~1068318870)
,(1214081090,~647310207)
,(77323136,1050508733)
,(~1700380220,1361536954)
,(~2054970673,937829394)
,(1717845244,~1870822279)
,(1837155942,1325636342)
,(~283056901,~2030703389)
,(~1416520099,~677528832)
,(687353114,~2065682587)
,(1054747422,~149690823)
,(693612774,770333700)
,(~445974334,517880878)
,(774369365,~1455533376)
,(~1258405701,1228143894)
,(1071278193,547617788)
,(1608037409,1547702331)
,(~660514692,~420259862)
,(952152604,657754271)
,(~1666664045,482699151)
,(~924257898,1577197075)
,(178926232,661429842)
,(1806410394,~479321782)
,(~1415844981,~741401112)
,(1591866400,~693563715)
,(1628952004,~679436453)
,(100029614,1580792533)
,(620859910,~536439861)
,(~1858014756,1593365463)
,(~875656342,307031092)
,(~1941168146,~859014521)
,(2083652722,~1424580000)
,(1601539041,938134743)
,(~1963510267,~246365875)
,(638162737,~823647507)
,(~25111041,833836170)
,(1762646800,1310484595)
,(942922178,979595765)
,(~684788840,~1593953981)
,(1275611925,~1019498124)
,(697488505,~754238567)
,(1590750133,1585516372)
,(336591448,44137602)
,(767073749,~1540874535)
,(1773702131,824099043)
,(843374817,~994903216)
,(~1474282113,1713221558)
,(1164822484,1601147130)
,(~512259909,213449457)
,(939710239,~1714547505)
,(~553027528,~208240002)
,(~1535405506,1482131925)
,(~1279530012,~1859643963)
,(~1429750312,488759634)
,(778600998,~1657855549)
,(~992426931,~1347271211)
,(335981873,~1178339677)
,(~1073203665,~1565502550)
,(~1295521610,~1531881143)
,(1597050881,1949319780)
,(~605807165,708752754)
,(1295222722,1932772670)
,(~1311797924,218160191)
,(~1371252497,~1317407377)
,(~1995760177,1573628795)
,(~215257455,135439444)
,(2083129085,~59989184)
,(340182218,60350704)
,(~966697630,1746477995)
,(~81247697,~2020417939)
,(~619475676,~1479200897)
,(784048432,1700162388)
,(~699882820,~1609735360)
,(1534855226,1936478666)
,(304927696,~639875953)
,(~504051437,1999111665)
,(~2052014909,2030658556)
,(~1591323539,~1848180906)
,(1660540277,1348131567)
,(~525284213,~660959916)
,(1356062335,~1288165669)
,(626413646,~1935453177)
,(~1728928416,1395629088)
,(1391151581,1776558080)
,(~1668653146,~1506609958)
,(611820413,243471439)
,(~2015355653,651948676)
,(1749328551,~1382188512)
,(554742934,809914758)
,(631852053,888054589)
,(~1116441734,1595983032)
,(~1941264993,2032241032)
,(~1069638845,323551460)
,(~1425759883,651154766)
,(~1878869499,1661382876)
,(691247654,1902510735)
,(~1474707246,~1514555031)
,(~1000011802,1305704560)
,(700959978,1653991791)
,(~864260369,~1218234055)
,(~185684355,~1301867555)
,(~1728972018,2102752632)
,(1537320819,425439079)
,(~595568495,~708063483)
,(~1887203149,299535141)
,(259498379,~990703049)
,(~1363154492,150155399)
,(505640295,48422938)
,(1950986642,1180861141)
,(~926375968,1003460678)
,(1955492514,2106917932)
,(~162516157,~1187418664)
,(1398229709,~797801795)
,(~2113028215,205866664)
,(~1388949073,~1345443772)
,(~921728805,1495153332)
,(~1195708519,1896998065)
,(1472691725,1091135981)
,(~24950977,1049352570)
,(~42957015,~1306623833)
,(1021470139,~630048751)
,(1188259275,1393974895)
,(~2011084509,73186803)
,(~403324611,~1453558870)
,(~339399332,1224300936)
,(~308604658,1735276210)
,(~1792422798,~691121250)
,(345629110,1853816381)
,(1338395860,~719294007)
,(~1232023734,698262492)
,(~464996355,~79776724)
,(794488155,~2010149793)
,(741751905,~1195463133)
,(1559695772,1696401532)
,(~804316351,~266950728)
,(1946185406,262921348)
,(~1773475994,1680658607)
,(782899496,~1043091474)
,(556387999,1310117962)
,(1069439254,1006318704)
,(~161623781,768888384)
,(~1854733752,~1755437786)
,(986260133,2083773472)
,(~1172394520,197245886)
,(1541440046,~1353871033)
,(2127618211,~1285160555)
,(~865413999,~1595838783)
,(~1601635132,1656722598)
,(638123753,659087990)
,(~959841296,~1323169703)
,(~569626349,~1353414479)
,(846536133,508761049)
,(1091392829,304996437)
,(1680033970,~1323229500)
,(~1386543712,~456052743)
,(~332281791,~345838695)
,(~960220883,2009477971)
,(1999275615,~1682925051)
,(~1157754611,193736666)
,(1218026421,2089952122)
,(1519222904,1523871283)
,(349484475,1531728484)
,(1565076389,1069835408)
,(~1491066482,~175804763)
,(~1643271876,467663975)
,(770208577,~2021537815)
,(~2071463908,~306640425)
,(729272600,1845771420)
,(827882789,1977962446)
,(~1323240491,1096492087)
,(466022802,~1475008801)
,(~639266313,~665429173)
,(1469813821,~1699742033)
,(763651426,409106325)
,(~1220270352,1148527325)
,(~292596335,1272228125)
,(~2037588896,1897144713)
,(~1482112010,~686814922)
,(1884612030,1977008180)
,(~1385593545,~1464415428)
,(68345793,~436116495)
,(~1852331303,~764591053)
,(1557325885,1507974743)
,(33162485,~78428197)
,(~223428592,~705358096)
,(1352254896,~1474466153)
,(~26506440,~1604853657)
,(~47588416,137037871)
,(1935141539,~2028230774)
,(~1365460957,~1651622977)
,(~58936902,~126984040)
,(1351783814,~572613430)
,(1301477238,~815778021)
,(383153631,~1285326713)
,(~524673586,158279235)
,(~777552951,~850624027)
,(1640776870,~1276437449)
,(634623957,~432583732)
,(~153848989,168580380)
,(~59017510,~1867276404)
,(2099955003,1985137067)
,(~808719539,1772713119)
,(1581533808,~1320262100)
,(2094401176,~207309131)
,(1406374670,~266187008)
,(2026521560,~2062071361)
,(1938405538,2126833858)
,(~1113886377,~1430097958)
,(280880667,~147802361)
,(1362284649,~2014472428)
,(1740859016,384612246)
,(~1280600785,1303344937)
,(158932879,~1693360341)
,(1447158267,~2070542908)
,(~1779670963,1758213491)
,(628505818,1029413620)
,(~319048908,~1984547341)
,(1652405649,48274584)
,(1049487591,1765745747)
,(~1520137310,~2020892084)
,(142073178,1275833235)
,(505197685,179327766)
,(815444204,1157138452)
,(46191890,1145294958)
,(963677139,~644378277)
,(1847127158,397188316)
,(~577312698,~1252149473)
,(~775174620,~1812094842)
,(~1375798876,~455831608)
,(~1254670372,~331334727)
,(1838459,240156789)
,(922490478,~75511525)
,(1416082086,~1138962014)
,(1826904509,~539395104)
,(1867026477,1670894014)
,(~1073258104,~1083545476)
,(~1138295150,676857344)
,(~1364319133,~111005036)
,(~1893606521,1968758634)
,(~386077060,1978521465)
,(~1979705081,1562706088)
,(~141266270,754575226)
,(~699239694,1093285110)
,(1237024476,~1396199659)
,(~1142978486,~611942784)
,(~869857539,~1141917760)
,(~1171860879,1002101284)
,(~1515111024,~1382796974)
,(~1336272603,1986037406)
,(1234478609,~3854575)
,(1271979105,~799246346)
,(29790274,1175898401)
,(~1955213305,~2000754402)
,(~545385626,~485642433)
,(1372902293,~1081950366)
,(~252957619,1577969472)
,(2083782179,714456724)
,(2040394796,~963940147)
,(367418100,809024229)
,(1436093100,1696230733)
,(~704052971,1171419764)
,(~550571795,~836711618)
,(1145282645,1561032529)
,(~1807339848,1206860357)
,(~2039384132,1344182452)
,(696481631,~1547158238)
,(364941466,~1433844459)
,(~1608739804,~1896696815)
,(1540408071,~1010702555)
,(2105657888,~1781197587)
,(~1329615904,~133342186)
,(2098986652,68906197)
,(~1081486198,209195075)
,(~594409344,814946732)
,(766964416,~351351961)
,(1264762791,1549195856)
,(~2068815591,1488160914)
,(~1678878705,1353337988)
,(36282763,1831867242)
,(~1617006003,857471259)
,(774577524,859235362)
,(~1711143793,~75013117)
,(~1194119858,~1789104972)
,(~866246365,1874550899)
,(~1461231000,1907151429)
,(1877803190,874325365)
,(~872407492,4257904)
,(806292099,~182657633)
,(810210516,1323513427)
,(209566936,~439905730)
,(~2024583843,395169910)
,(~431643114,~712764092)
,(156232486,~1594794969)
,(2012581969,~955335737)
,(836673332,1650620399)
,(~1283334335,1633319900)
,(716678607,1902457806)
,(~1656898023,~1265467946)
,(908040167,969275826)
,(967470286,~738329196)
,(~1952046646,~1447981553)
,(~1758409875,477321405)
,(~1176965054,1455705575)
,(~1096213141,2013362247)
,(~629639206,1993610314)
,(467184333,17432365)
,(~1766565970,1876627257)
,(~1577020079,~1588357235)
,(~2133434096,1604973437)
,(~763497659,~160110186)
,(~31341256,1054945073)
,(~407115014,1608237093)
,(~122599085,2056012611)
,(~1368597565,~2065342208)
,(~1218028921,1029666172)
,(782153551,1542217101)
,(~1938822733,~676847017)
,(1750745690,1434601174)
,(822303806,~2017253555)
,(~505627412,820464079)
,(~1206488148,~1289155690)
,(~1788911231,1520878411)
,(884474104,916928130)
,(~1075212187,578706472)
,(175577316,1284931666)
,(~1735802426,1678625815)
,(528241489,1027664487)
,(883996837,1801600549)
,(677991993,906999698)
,(1374651158,1228259711)
,(~1907688174,~2061866582)
,(~1661451331,911591446)
,(~847160289,256821563)
,(385115080,101663416)
,(1141854430,854457767)
,(1623387676,~1247216457)
,(241298564,~862465769)
,(2076970093,~2124625681)
,(1306791535,2006324616)
,(805012779,~551551151)
,(~339953185,962361927)
,(1160215650,1179273892)
,(1284968744,1347895265)
,(~269848012,~502688925)
,(~153188213,1446179115)
,(~864625538,~373420006)
,(~755719246,295616915)
,(1899349546,~1181823421)
,(~323552813,~325536976)
,(~353916078,~1712281442)
,(202854734,~1787821008)
,(1350712470,~1506518648)
,(867000855,~167831280)
,(~377207993,2078523845)
,(~1869722978,1938140086)
,(~230907114,599844581)
,(~1356223200,840880356)
,(~1148684577,1506583953)
,(1701601743,~385456253)
,(~1543278904,1716221531)
,(~279632102,2040462848)
,(76484717,11216680)
,(1821400575,1170789564)
,(~84905509,1209068648)
,(~1051050701,1231338378)
,(241711879,2043096020)
,(~674407042,1328829578)
,(486036495,221924271)
,(2044513557,2038469079)
,(764979914,~1577918164)
,(1524238846,~1238849113)
,(1492442351,2101128155)
,(279293010,~1930910651)
,(~797017055,1635366860)
,(~1453931002,~2042848072)
,(~836564244,~239424964)
,(7389627,642804794)
,(~1015082326,673868476)
,(~1303971468,~1666457135)
,(1089458780,~2025714150)
,(1182554492,~1415332374)
,(~50188212,1755719504)
,(1940920834,~1398556598)
,(~406038857,~583687875)
,(618282588,1206652235)
,(1760509316,2002098720)
,(~1577199622,~1080342971)
,(636468098,~2130668415)
,(~897286033,1503707905)
,(~1967505865,~515016696)
,(391892669,89047774)
,(1633090454,~866847168)
,(~42170477,977472857)
,(~1325839247,164467349)
,(~1889809475,1549044976)
,(1086049596,560017631)
,(~959007091,~387262408)
,(1475008470,1720677266)
,(~1672554313,~1626406073)
,(830396013,1724875416)
,(~458798978,1146424265)
,(1519553273,~890112934)
,(~1487756114,1805325625)
,(1594675909,1578541006)
,(608229282,~2133267058)
,(~883716312,1502942043)
,(407772526,950207562)
,(~1348064501,1155235700)
,(1592680573,~46705994)
,(904394412,1305329141)
,(1576731481,562915250)
,(1298283749,~375418868)
,(~183852203,165295077)
,(~68170203,2128057566)
,(981020912,~268916378)
,(1731362003,~813216651)
,(~947907322,744737777)
,(928804180,~1857271026)
,(~1792767985,~13249789)
,(727862166,~1941832718)
,(~801177465,801203510)
,(~1636117688,1046033131)
,(934637475,521063937)
,(~191639345,~58364693)
,(~796225874,1274564144)
,(1371440378,~731580691)
,(~2086581429,2086283948)
,(~840208543,1117476982)
,(~1165559409,1444677905)
,(1771598082,~339366059)
,(~1941369604,529783628)
,(~31253920,574495865)
,(1296425450,1651636246)
,(~1371592985,2097581717)
,(~1162295999,~1420005029)
,(742260111,~1594793319)
,(~1489506526,1389400419)
,(1527590515,420540784)
,(198333278,~137449834)
,(~925654477,1032763914)
,(26884245,462200856)
,(~2078707484,~988000246)
,(167209463,1429475639)
,(~1767409892,~1541549068)
,(389782123,~654965265)
,(1419765245,403501636)
,(1467781182,998100611)
,(~770864927,~696078379)
,(278846247,754482803)
,(~1707942562,~1348233538)
,(~2058849503,~1743059390)
,(122900769,~1958126220)
,(~598019471,1141575384)
,(229836971,1628686533)
,(777676146,~750286488)
,(155889535,416550787)
,(~291904655,2114400655)
,(~2137280425,~263301360)
,(1095641852,586199638)
,(~2067425190,326290038)
,(~1353128983,~2028678160)
,(2118741160,~1085867526)
,(1088602250,310402025)
,(452108970,1412731833)
,(~949366619,~462883466)
,(813815708,110270648)
,(~1278936246,1597845274)
,(~1365046509,1349760976)
,(~372589842,747515162)
,(1137538104,~1853711369)
,(1778390692,476428446)
,(~1118347328,~542244489)
,(1770639634,1511227389)
,(~1934956315,~930318624)
,(1387187868,2037370226)
,(2135706531,~1859324443)
,(~1461565310,~391028078)
,(590728017,~476481468)
,(758776327,~1487969014)
,(1935653278,~1261807854)
,(~1894635297,75540409)
,(~295793532,1459849426)
,(2134939068,~1386388990)
,(825496038,642190674)
,(~863716161,1418512531)
,(1293031347,330021205)
,(~1356609479,~1173838707)
,(1672209208,~1420642069)
,(282965310,1184515784)
,(~1505801473,865724427)
,(135573134,494940485)
,(~164763995,78857131)
,(~1575513775,2117661303)
,(309864906,1940779524)
,(~1405101549,994929903)
,(1558700364,319257620)
,(~378945815,~1812140797)
,(~1190241374,~162924126)
,(1394519699,~340232803)
,(~586416721,~1331771345)
,(~1276781400,~261150239)
,(~1945050634,662008284)
,(211082151,1870872166)
,(~1310674924,~188922131)
,(~231854449,969586668)
,(~1937884059,~83388869)
,(~309978295,~1347935431)
,(1976774349,~1630774719)
,(~1257690646,1282889887)
,(1313110165,~324153328)
,(~317386658,733832100)
,(1774072466,~1102482888)
,(660557049,~1586878797)
,(~1340819102,~580211897)
,(1675523507,610009862)
,(~192461845,1587678618)
,(1043582876,~259611283)
,(~1149889623,48145781)
,(~7534321,~1758300673)
,(1520147318,~1752196965)
,(~399033477,795369665)
,(~285913011,~556864859)
,(1969196105,308009804)
,(~1249600520,470396059)
,(~651465735,1943800329)
,(~1970976858,~2034627386)
,(~1686379144,32217708)
,(~692962650,~108060725)
,(~49748396,~724315297)
,(1161637545,1354167310)
,(~1903015239,1817508419)
,(818050441,~149345212)
,(~957832707,1440274359)
,(444705426,~1511155126)
,(~45875927,676022566)
,(~334836113,~893045450)
,(706927272,828476431)
,(~1313672553,1441895010)
,(~1516887468,1136900885)
,(1322021069,1613267440)
,(896516090,~756842269)
,(1813735178,~1510394004)
,(707587922,1299626897)
,(58299237,825390115)
,(~92274466,~951307074)
,(754920917,424136880)
,(1483808654,~1028690326)
,(~1207919793,~70506131)
,(~809662447,~444123984)
,(~268015274,~67680598)
,(616566444,~548896684)
,(606966645,~88234846)
,(~1856662461,1460411267)
,(2015320299,~204067472)
,(~455766779,~255176900)
,(~363833644,~560339654)
,(1534354575,~1218244168)
,(1957452708,2115912937)
,(1934264470,~1628837794)
,(~969323158,~1042483577)
,(~2108808770,1436507874)
,(~2054574932,~2072253628)
,(404761901,~1402932128)
,(758302866,542625186)
,(~416557920,~967588191)
,(~226516009,925521504)
,(~455500147,~1320834711)
,(234623855,~1204657679)
,(410619472,1694461939)
,(~1105519725,356110613)
,(~1137037716,923053643)
,(~16196231,~1970106485)
,(~1160563044,1551862598)
,(~1525040571,~1050942252)
,(~1870976569,35813128)
,(~1435619784,~2017576301)
,(400610096,~606920304)
,(~1222253938,~1161637456)
,(~234149455,~393488308)
,(699841384,186624911)
,(520748088,969343316)
,(~2017165365,~416646692)
,(~556523819,~272606298)
,(794902899,911103152)
,(~1202927442,365719189)
,(~1117838651,~268371395)
,(721545500,~328017537)
,(~2069962934,~1963199008)
,(~317476148,~82318296)
,(426650179,~1700484436)
,(889494254,~1632848914)
,(~1536171985,1724548488)
,(~84043860,~171334390)
,(1171291701,1848024122)
,(502906271,10947353)
,(~731912364,~1055410316)
,(1807206251,553252327)
,(1073528160,~773433064)
,(1127741322,~631476510)
,(~1241460601,~1322683975)
,(1462625002,~1999377127)
,(~319807043,553694283)
,(~1993821679,~612924795)
,(~1312907958,~759666597)
,(~1961717386,285819017)
,(766446107,~646239290)
,(~872026591,717819422)
,(~1607551622,~852581559)
,(~736966683,417259913)
,(914406797,962471750)
,(1612178740,~2139813376)
,(2138957447,~451169598)
,(~1788645834,~178828723)
,(344369896,~2026726584)
,(209070536,128240886)
,(1803494393,834404126)
,(~357575405,362674476)
,(~1662542210,552791424)
,(~1004504807,~173457530)
,(1644537373,561529446)
,(759067498,1147966054)
,(~933929857,~1539548711)
,(1875242907,~1913469462)
,(808573143,629557644)
,(~1314803246,~1627885474)
,(~778415678,153901815)
,(227860668,1787830499)
,(~1827368352,167323131)
,(1972793548,1909075592)
,(~1828415289,~1631599760)
,(~2061948668,~1553034085)
,(156621657,2988683)
,(1450883878,~1376711539)
,(~337440975,~2061910719)
,(~1009358683,~1931211392)
,(~1897081502,1676765049)
,(~401091788,1518044320)
,(~1723698641,1042173024)
,(967649465,1002460977)
,(1758910020,1548735774)
,(~585716481,841800063)
,(1309724889,687360877)
,(~765894182,~175664195)
,(~1466349524,1680494546)
,(1751405157,230374149)
,(1399876636,1699012486)
,(~463134641,~1752766140)
,(803984614,~2028635668)
,(1269578758,~1107810478)
,(~1658953891,486588952)
,(43275338,~1252542044)
,(~1224289725,~372556120)
,(~1449738871,1471044232)
,(~618279852,2060810980)
,(1310574470,1700298308)
,(111497962,451389028)
,(~1407499632,~737849229)
,(~788314063,125319197)
,(~1011196353,1976115610)
,(~627942780,382444169)
,(461299758,1312182598)
,(~1189674834,269515529)
,(1690764189,308280435)
,(~256537165,~463953704)
,(~1712283008,~1286147603)
,(~2104654306,~2078195015)
,(13089901,1799830425)
,(~2086674649,~1369865673)
,(1231607895,~1112002265)
,(623726225,~651997544)
,(824648405,~899235972)
,(~1252475396,479478002)
,(1431739300,594505900)
,(~951042291,~1445221543)
,(~431665068,482396250)
,(~350464682,1689667928)
,(589811580,1066048555)
,(241689500,706948010)
,(~1266521627,~240504011)
,(~857149285,986022338)
,(~1641038464,~834290731)
,(~1239599001,1502570532)
,(155864700,~842510299)
,(2073907038,34726810)
,(~808097910,~1267097459)
,(1402618927,~1215741656)
,(1269301981,~1090661891)
,(~637934528,1138078576)
,(810442667,~1927428007)
,(~483620381,531813299)
,(596905702,962696676)
,(438909290,~1775276741)
,(1864085838,~2046136400)
,(247936104,~823945792)
,(246630646,1010571781)
,(798228918,~800607881)
,(2020944444,~736760980)
,(584896713,1718647340)
,(~20878545,~1457905037)
,(1683218312,~2099838371)
,(109296788,~1855366037)
,(1489496995,~1134966391)
,(1226868637,1369710959)
,(409862348,443940671)
,(~522865432,271546006)
,(2050916606,~693851084)
,(~296683288,1642979194)
,(~373308825,~1000627796)
,(~100912062,1991496900)
,(1355701926,~202985965)
,(1425415014,~1544315059)
,(88969923,~903353504)
,(~363457390,~1202396208)
,(~919101043,~23148881)
,(393452946,896547581)
,(1729712570,4422332)
,(456129159,~205451558)
,(81282604,~243661047)
,(1819251915,131650853)
,(~1060802690,~449594139)
,(~710985304,~1613018024)
,(~809959013,~1692633040)
,(~1633625763,1838631436)
,(1739728430,1488968707)
,(983909031,1319951333)
,(1643617626,318112454)
,(~525234366,~1508013519)
,(~1865832948,686946276)
,(311820507,~223644625)
,(~42727237,912575674)
,(~94625666,1153522549)
,(~1378753311,~1910662514)
,(1780331248,~1710982038)
,(~1176452602,1351272996)
,(~244521105,1277425752)
,(~2061999932,439616175)
,(1731007812,~469015694)
,(~1100045221,1427687261)
,(~975034102,~1019150376)
,(~1009208154,~1599806292)
,(1026003612,231213204)
,(~989887124,~984965902)
,(~692184755,~1165486935)
,(~1639699197,~2112293698)
,(~598755860,1806402200)
,(957124872,~917697417)
,(1657792440,1631163279)
,(~148180015,109911931)
,(137112176,~717135325)
,(~615989158,~831790781)
,(~2065690501,~879943079)
,(~1219834006,596114410)
,(~963215348,~1145197767)
,(1458588945,405442360)
,(~1407769450,~1191114225)
,(~2100930797,~168960101)
,(971030689,1600881045)
,(1609654663,~960242744)
,(~170934086,236593489)
,(~1375539536,~1009466192)
,(~122189899,~1949983129)
,(332270355,~476918763)
,(~170265105,~1295067822)
,(~1815165785,~2122284383)
,(209072901,~446305434)
,(~831881493,1714487047)
,(353250876,989468485)
,(1147044450,~1051373258)
,(~762191046,~143547269)
,(1761675990,1889295550)
,(~2140118031,~1741739780)
,(1594374122,120295497)
,(~731760346,~1284094589)
,(~422133400,~2108405062)
,(1993741374,197403448)
,(~138653158,~127947737)
,(967349735,~2134477919)
,(~1801191308,~526718617)
,(1324703570,2146748108)
,(1589114384,~1706538494)
,(~1860655597,~2031102661)
,(1675438440,1132163173)
,(~1778816683,2010234200)
,(466160219,1048614644)
,(~2024073967,927007071)
,(~1147977313,~474904948)
,(975952629,~872936028)
,(~1052656810,1580744611)
,(~153396956,1895755061)
,(1967313486,1333168195)
,(~1566200786,~1372003397)
];
List.app (fn x => (print ("fromLarge " ^ LargeInt.toString x ^ " = "); call Int32.fromLarge x))
[~2147483648
,~2147483647
,~77
,~3
,~2
,~1
,0
,1
,2
,3
,78
,2147483646
,2147483647
,1144840752
,~1913994601
,477126751
,~550241521
,~167378736
,~825788974
,1294491537
,~1016783337
,~842157429
,57534559
,178802164
,148898098
,1622309563
,384086917
,1059572110
,~1010057431
,809201400
,2108944990
,~1423401636
,~9314725
,580535533
,~60462977
,42173506
,~1244198391
,~155416245
,578536091
,~848818054
,~738569704
,843505297
,915780832
,~1997966006
,~1047164766
,605389538
,1633732331
,644804127
,~1169784920
,~2028850213
,637053474
,~261085742
,~452348227
,~2054800312
,823738987
,~290329616
,1105878397
,~390947178
,~82484296
,~1637257353
,~1744525921
,1037774837
,~117579738
,46021029015
,32798949607
,~66190941409
,57314705350
,30955205921
,~44619571292
,4301514095
,56098252958
,~26338499675
,~1532580608
,~67652687277
,~47093223262
,35071574791
,65209204795
,~22370891920
,~68128348459
,~33290190928
,~39989377418
,65310906683
,~66900984717
,~23912160493
,~6886979957
,~35296905132
,9010371032
,29369633131
,~33615846849
,23062844860
,~22836282248
,~68460387797
,~7789362155
,~30382133659
,10448667180
,~33765427150
,6768940769
,25736864631
,~5875626898
,63150016769
,59958189118
,2559004984
,~55215049712
,39585374335
,~43667560639
,26968284412
,~3317302599
,~40492762274
,8795026883
,12201631325
,55564749055
,33621315424
,~68403683654
,~36751655613
,~35183196309
,~30970415685
,~14617992548
,15388381844
,30718325341
,~17990749531
,19556184924
,23207024316
,55433405985
,42134722664
,45993217630
,30631047252
,~26416797328
,54059987406
,~41350206871
,53815438602
,39631315293
,32548436636
,~33873752237
,20253588333
,62604569549
,~31858983865
,51046101583
,61683991736
,55178550608
,48520998912
,20917427248
,29805005857
,~32525472367
,64564736645
,~30256445131
,30860253382
,58203560446
,18020004287
,40347760421
,~36773213283
,68124109667
,13857128546
,~22783785004
,~8197620743
,~45259347167
,60477473170
,16741595407
,40134835629
,25666135839
,53787131226
,~60464216657
,~43948593801
,~533421899
];
List.app (fn s => (print ("fromString " ^ s ^ " = "); callO Int32.fromString s))
["-2147483648"
,"-2147483647"
,"-77"
,"-3"
,"-2"
,"-1"
,"0"
,"1"
,"2"
,"3"
,"78"
,"2147483646"
,"2147483647"
,"1144840752"
,"-1913994601"
,"477126751"
,"-550241521"
,"-167378736"
,"-825788974"
,"1294491537"
,"-1016783337"
,"-842157429"
,"57534559"
,"178802164"
,"148898098"
,"1622309563"
,"384086917"
,"1059572110"
,"-1010057431"
,"809201400"
,"2108944990"
,"-1423401636"
,"-9314725"
,"580535533"
,"-60462977"
,"42173506"
,"-1244198391"
,"-155416245"
,"578536091"
,"-848818054"
,"-738569704"
,"843505297"
,"915780832"
,"-1997966006"
,"-1047164766"
,"605389538"
,"1633732331"
,"644804127"
,"-1169784920"
,"-2028850213"
,"637053474"
,"-261085742"
,"-452348227"
,"-2054800312"
,"823738987"
,"-290329616"
,"1105878397"
,"-390947178"
,"-82484296"
,"-1637257353"
,"-1744525921"
,"1037774837"
,"-117579738"
,"46021029015"
,"32798949607"
,"-66190941409"
,"57314705350"
,"30955205921"
,"-44619571292"
,"4301514095"
,"56098252958"
,"-26338499675"
,"-1532580608"
,"-67652687277"
,"-47093223262"
,"35071574791"
,"65209204795"
,"-22370891920"
,"-68128348459"
,"-33290190928"
,"-39989377418"
,"65310906683"
,"-66900984717"
,"-23912160493"
,"-6886979957"
,"-35296905132"
,"9010371032"
,"29369633131"
,"-33615846849"
,"23062844860"
,"-22836282248"
,"-68460387797"
,"-7789362155"
,"-30382133659"
,"10448667180"
,"-33765427150"
,"6768940769"
,"25736864631"
,"-5875626898"
,"63150016769"
,"59958189118"
,"2559004984"
,"-55215049712"
,"39585374335"
,"-43667560639"
,"26968284412"
,"-3317302599"
,"-40492762274"
,"8795026883"
,"12201631325"
,"55564749055"
,"33621315424"
,"-68403683654"
,"-36751655613"
,"-35183196309"
,"-30970415685"
,"-14617992548"
,"15388381844"
,"30718325341"
,"-17990749531"
,"19556184924"
,"23207024316"
,"55433405985"
,"42134722664"
,"45993217630"
,"30631047252"
,"-26416797328"
,"54059987406"
,"-41350206871"
,"53815438602"
,"39631315293"
,"32548436636"
,"-33873752237"
,"20253588333"
,"62604569549"
,"-31858983865"
,"51046101583"
,"61683991736"
,"55178550608"
,"48520998912"
,"20917427248"
,"29805005857"
,"-32525472367"
,"64564736645"
,"-30256445131"
,"30860253382"
,"58203560446"
,"18020004287"
,"40347760421"
,"-36773213283"
,"68124109667"
,"13857128546"
,"-22783785004"
,"-8197620743"
,"-45259347167"
,"60477473170"
,"16741595407"
,"40134835629"
,"25666135839"
,"53787131226"
,"-60464216657"
,"-43948593801"
,"-533421899"
];
List.app (fn s => (print ("scan BIN " ^ s ^ " = "); callO (StringCvt.scanString (Int32.scan StringCvt.BIN)) s))
["-10000000000000000000000000000000"
,"-1111111111111111111111111111111"
,"-1001101"
,"-11"
,"-10"
,"-1"
,"0"
,"1"
,"10"
,"11"
,"1001110"
,"1111111111111111111111111111110"
,"1111111111111111111111111111111"
,"1000100001111001110001000110000"
,"-1110010000101010011110101101001"
,"11100011100000110000001011111"
,"-100000110011000000010011110001"
,"-1001111110011111111100110000"
,"-110001001110001000101000101110"
,"1001101001010000101111110010001"
,"-111100100110101110000111101001"
,"-110010001100100100110101110101"
,"11011011011110100001011111"
,"1010101010000100110111110100"
,"1000111000000000000100110010"
,"1100000101100100111101010111011"
,"10110111001001011001110000101"
,"111111001001111100100110001110"
,"-111100001101000100000011010111"
,"110000001110110110111011111000"
,"1111101101100111111001001011110"
,"-1010100110101110110001010100100"
,"-100011100010000110100101"
,"100010100110100100010011101101"
,"-11100110101001011110000001"
,"10100000111000010001000010"
,"-1001010001010001111010111110111"
,"-1001010000110111011010110101"
,"100010011110111100001010011011"
,"-110010100101111110111110000110"
,"-101100000001011010110111101000"
,"110010010001101101111010010001"
,"110110100101011011010011100000"
,"-1110111000101101000101010110110"
,"-111110011010100111011101011110"
,"100100000101011000001011100010"
,"1100001011000001100011011101011"
,"100110011011101110111000011111"
,"-1000101101110011000000001011000"
,"-1111000111011011100110000100101"
,"100101111110001010101000100010"
,"-1111100011111101101000101110"
,"-11010111101100100100101000011"
,"-1111010011110011100001110111000"
,"110001000110010100001001101011"
,"-10001010011100001010000010000"
,"1000001111010100101110101111101"
,"-10111010011010110000101101010"
,"-100111010101001110001001000"
,"-1100001100101101001000010001001"
,"-1100111111110110101101001100001"
,"111101110110110010111111110101"
,"-111000000100001111111011010"
,"101010110111000100010010110010010111"
,"11110100010111110000100000011100111"
,"-111101101001010010011001110011100001"
,"110101011000001110001111111111000110"
,"11100110101000100101111010100100001"
,"-101001100011100010001010000001011100"
,"100000000011000111110010101101111"
,"110100001111101101110110100010011110"
,"-11000100001111001011001110001011011"
,"-1011011010110010101001100000000"
,"-111111000000011010100001010110101101"
,"-101011110110111110011000111101011110"
,"100000101010011011011100001100000111"
,"111100101110110001011000000000111011"
,"-10100110101011010001011100010010000"
,"-111111011100110001000001100100101011"
,"-11111000000010000000000000001010000"
,"-100101001111100011010111100110001010"
,"111100110100110101010101100100111011"
,"-111110010011100111000000001110001101"
,"-10110010001010001101001110011101101"
,"-110011010011111101111100101110101"
,"-100000110111110111000000011110101100"
,"1000011001000011110101100111011000"
,"11011010110100100010000100101101011"
,"-11111010011101010010001110111000001"
,"10101011110101001110001010110111100"
,"-10101010001001001100000001110001000"
,"-111111110000100011101001110111010101"
,"-111010000010010000011101111101011"
,"-11100010010111010101001000110011011"
,"1001101110110010100000001000101100"
,"-11111011100100100111000011111001110"
,"110010011011101011101011011100001"
,"10111111110000010010110001101110111"
,"-101011110001101101111001110010010"
,"111010110100000010001100100100000001"
,"110111110101110010010101110000111110"
,"10011000100001110101000100111000"
,"-110011011011000100101100101111110000"
,"100100110111011110001110000001111111"
,"-101000101010110010100001100010111111"
,"11001000111011011110101110011111100"
,"-11000101101110100000010101000111"
,"-100101101101100011101000010010100010"
,"1000001100001110010111010111000011"
,"1011010111010001100001111001011101"
,"110011101111111010101100100011111111"
,"11111010011111111001000111101100000"
,"-111111101101001011010110000101000110"
,"-100010001110100100011100001010111101"
,"-100000110001000101001111100010010101"
,"-11100110101111110110000101001000101"
,"-1101100111010011001101110101100100"
,"1110010101001110000001001010010100"
,"11100100110111101000111001001011101"
,"-10000110000010101010000110101011011"
,"10010001101101000111011001101011100"
,"10101100111001111110001011010111100"
,"110011101000000101101010011000100001"
,"100111001111011011001101100001101000"
,"101010110101011010001100111001011110"
,"11100100001110000001011000001010100"
,"-11000100110100100000101011010010000"
,"110010010110001110011111000111001110"
,"-100110100000101010100001010110010111"
,"110010000111101001100110110100001010"
,"100100111010001101011110000101011101"
,"11110010100000010011011101010011100"
,"-11111100011000010000111000010101101"
,"10010110111001101010011101101101101"
,"111010010011100001011110101111001101"
,"-11101101010111100011000001110111001"
,"101111100010100101011011001001001111"
,"111001011100101001110000010010111000"
,"110011011000111001011101110101010000"
,"101101001100000100111011000000000000"
,"10011011110110001101001110000110000"
,"11011110000100001000100110000100001"
,"-11110010010101010110101001001101111"
,"111100001000010110111011001010000101"
,"-11100001011011011001011011011001011"
,"11100101111011010100001100011000110"
,"110110001101001100111101100111111110"
,"10000110010000100110111000110111111"
,"100101100100111010011111011100100101"
,"-100010001111110110101011010001100011"
,"111111011100100000110110101101100011"
,"1100111001111100110000000001100010"
,"-10101001110000001001111100000101100"
,"-111101000100111011100010000000111"
,"-101010001001101010101101010011011111"
,"111000010100101111010000000110010010"
,"1111100101111000000111100100001111"
,"100101011000001110001111110110101101"
,"10111111001110100100010011100011111"
,"110010000101111101100111110101011010"
,"-111000010011111100101011101001010001"
,"-101000111011100010100101001010001001"
,"-11111110010110101111101001011"
];
List.app (fn s => (print ("scan OCT " ^ s ^ " = "); callO (StringCvt.scanString (Int32.scan StringCvt.OCT)) s))
["-20000000000"
,"-17777777777"
,"-115"
,"-3"
,"-2"
,"-1"
,"0"
,"1"
,"2"
,"3"
,"116"
,"17777777776"
,"17777777777"
,"10417161060"
,"-16205236551"
,"3434060137"
,"-4063002361"
,"-1176377460"
,"-6116105056"
,"11512057621"
,"-7446560751"
,"-6214446565"
,"333364137"
,"1252046764"
,"1070000462"
,"14054475273"
,"2671131605"
,"7711744616"
,"-7415040327"
,"6016667370"
,"17554771136"
,"-12465661244"
,"-43420645"
,"4246442355"
,"-346513601"
,"240702102"
,"-11212172767"
,"-1120673265"
,"4236741233"
,"-6245767606"
,"-5401326750"
,"6221557221"
,"6645332340"
,"-16705505266"
,"-7632473536"
,"4405301342"
,"14130143353"
,"4633567037"
,"-10556300130"
,"-17073346045"
,"4576125042"
,"-1743755056"
,"-3275444503"
,"-17236341670"
,"6106241153"
,"-2123412020"
,"10172456575"
,"-2723260552"
,"-472516110"
,"-14145510211"
,"-14776655141"
,"7566627765"
,"-700417732"
,"526704226227"
,"364276040347"
,"-755122316341"
,"653016177706"
,"346504572441"
,"-514342120134"
,"40030762557"
,"641755664236"
,"-304171316133"
,"-13326251400"
,"-770032412655"
,"-536676307536"
,"405233341407"
,"745661300073"
,"-246532134220"
,"-773461014453"
,"-370020000120"
,"-451743274612"
,"746465254473"
,"-762347001615"
,"-262121516355"
,"-63237574565"
,"-406767003654"
,"103103654730"
,"332644204553"
,"-372352216701"
,"253651612674"
,"-252111401610"
,"-776043516725"
,"-72022035753"
,"-342272510633"
,"115662401054"
,"-373444703716"
,"62335353341"
,"277602261567"
,"-53615571622"
,"726402144401"
,"676562256076"
,"23041650470"
,"-633304545760"
,"446736160177"
,"-505262414277"
,"310733656374"
,"-30556402507"
,"-455543502242"
,"101416272703"
,"132721417135"
,"635772544377"
,"372377107540"
,"-775513260506"
,"-421644341275"
,"-406105174225"
,"-346576605105"
,"-154723156544"
,"162516011224"
,"344675071135"
,"-206025206533"
,"221550731534"
,"254717613274"
,"635005523041"
,"471733154150"
,"526532147136"
,"344160130124"
,"-304644053220"
,"622616370716"
,"-464052412627"
,"620751466412"
,"447215360535"
,"362402335234"
,"-374302070255"
,"226715235555"
,"722341365715"
,"-355274301671"
,"574245331117"
,"713451602270"
,"633071356520"
,"551404730000"
,"233661516060"
,"336041046041"
,"-362252651157"
,"741026731205"
,"-341333133313"
,"345732414306"
,"661514754776"
,"206204670677"
,"454472373445"
,"-421766532143"
,"773440665543"
,"147174600142"
,"-251601174054"
,"-75047342007"
,"-521152552337"
,"702457200622"
,"174570074417"
,"453016176655"
,"277164423437"
,"620575476532"
,"-702374535121"
,"-507342451211"
,"-3762657513"
];
List.app (fn s => (print ("scan HEX " ^ s ^ " = "); callO (StringCvt.scanString (Int32.scan StringCvt.HEX)) s))
["-80000000"
,"-7fffffff"
,"-4d"
,"-3"
,"-2"
,"-1"
,"0"
,"1"
,"2"
,"3"
,"4e"
,"7ffffffe"
,"7fffffff"
,"443ce230"
,"-72153d69"
,"1c70605f"
,"-20cc04f1"
,"-9f9ff30"
,"-31388a2e"
,"4d285f91"
,"-3c9ae1e9"
,"-32324d75"
,"36de85f"
,"aa84df4"
,"8e00132"
,"60b27abb"
,"16e4b385"
,"3f27c98e"
,"-3c3440d7"
,"303b6ef8"
,"7db3f25e"
,"-54d762a4"
,"-8e21a5"
,"229a44ed"
,"-39a9781"
,"2838442"
,"-4a28f5f7"
,"-94376b5"
,"227bc29b"
,"-3297ef86"
,"-2c05ade8"
,"3246de91"
,"3695b4e0"
,"-77168ab6"
,"-3e6a775e"
,"241582e2"
,"6160c6eb"
,"266eee1f"
,"-45b98058"
,"-78edcc25"
,"25f8aa22"
,"-f8fda2e"
,"-1af64943"
,"-7a79c3b8"
,"3119426b"
,"-114e1410"
,"41ea5d7d"
,"-174d616a"
,"-4ea9c48"
,"-61969089"
,"-67fb5a61"
,"3ddb2ff5"
,"-7021fda"
,"ab7112c97"
,"7a2f840e7"
,"-f69499ce1"
,"d5838ffc6"
,"73512f521"
,"-a6388a05c"
,"10063e56f"
,"d0fb7689e"
,"-621e59c5b"
,"-5b595300"
,"-fc06a15ad"
,"-af6f98f5e"
,"82a6dc307"
,"f2ec5803b"
,"-53568b890"
,"-fdcc4192b"
,"-7c0400050"
,"-94f8d798a"
,"f34d5593b"
,"-f939c038d"
,"-591469ced"
,"-19a7ef975"
,"-837dc07ac"
,"2190f59d8"
,"6d691096b"
,"-7d3a91dc1"
,"55ea715bc"
,"-551260388"
,"-ff08e9dd5"
,"-1d0483beb"
,"-712ea919b"
,"26eca022c"
,"-7dc9387ce"
,"19375d6e1"
,"5fe096377"
,"-15e36f392"
,"eb408c901"
,"df5c95c3e"
,"98875138"
,"-cdb12cbf0"
,"93778e07f"
,"-a2aca18bf"
,"6476f5cfc"
,"-c5ba0547"
,"-96d8e84a2"
,"20c3975c3"
,"2d7461e5d"
,"cefeac8ff"
,"7d3fc8f60"
,"-fed2d6146"
,"-88e91c2bd"
,"-83114f895"
,"-735fb0a45"
,"-3674cdd64"
,"395381294"
,"726f4725d"
,"-430550d5b"
,"48da3b35c"
,"5673f16bc"
,"ce816a621"
,"9cf6cd868"
,"ab568ce5e"
,"721c0b054"
,"-626905690"
,"c9639f1ce"
,"-9a0aa1597"
,"c87a66d0a"
,"93a35e15d"
,"79409ba9c"
,"-7e30870ad"
,"4b7353b6d"
,"e9385ebcd"
,"-76af183b9"
,"be295b24f"
,"e5ca704b8"
,"cd8e5dd50"
,"b4c13b000"
,"4dec69c30"
,"6f0844c21"
,"-792ab526f"
,"f085bb285"
,"-70b6cb6cb"
,"72f6a18c6"
,"d8d33d9fe"
,"4321371bf"
,"964e9f725"
,"-88fdab463"
,"fdc836b63"
,"339f30062"
,"-54e04f82c"
,"-1e89dc407"
,"-a89aad4df"
,"e14bd0192"
,"3e5e0790f"
,"95838fdad"
,"5f9d2271f"
,"c85f67d5a"
,"-e13f2ba51"
,"-a3b8a5289"
,"-1fcb5f4b"
];
